package com.torry.edss.integration.feign.eastmoney.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @author torry.wang
 */
@Data
@ApiModel("股票K线数据响应")
public class EMDailyLineResponse {

    @JsonProperty("rc")
    @ApiModelProperty(value = "返回码")
    private Integer returnCode;

    @JsonProperty("rt")
    @ApiModelProperty(value = "响应时间（毫秒）")
    private Integer responseTime;

    @ApiModelProperty("股票数据详情")
    private StockData data;

    @JsonProperty("lt")
    @ApiModelProperty(value = "未知字段（需确认用途）")
    private Integer lt;

    @JsonProperty("dlmkts")
    @ApiModelProperty(value = "未知字段（需确认用途）")
    private String dlMkts;

    @JsonProperty("svr")
    @ApiModelProperty(value = "服务器标识")
    private Long serverId;

    @JsonProperty("full")
    @ApiModelProperty(value = "是否全量数据")
    private Integer full;

    @Data
    @ApiModel("股票数据详情")
    public static class StockData {

        @JsonProperty("code")
        @ApiModelProperty(value = "股票代码", example = "000001")
        private String code;

        @JsonProperty("market")
        @ApiModelProperty(value = "市场类型", example = "0")
        private Integer market;

        @JsonProperty("name")
        @ApiModelProperty(value = "股票名称", example = "平安银行")
        private String name;

        @JsonProperty("decimal")
        @ApiModelProperty(value = "价格小数位数", example = "2")
        private Integer decimalPlaces;

        @JsonProperty("dktotal")
        @ApiModelProperty(value = "K线总数", example = "8144")
        private Integer klineTotal;

        @JsonProperty("preKPrice")
        @ApiModelProperty(value = "前收盘价", example = "11.27")
        private Double prePrice;

        @ApiModelProperty(value = "K线数据列表")
        /**
         * 格式：日期，开盘价，收盘价（如果是盘中代表当前价)，最高价，最低价，成交量（手）,成交额（元）,振幅（%）, 涨幅（%），涨跌额（元），换手率（%）
         */
        private List<String> klines;
    }
}